home *** CD-ROM | disk | FTP | other *** search
/ Imagination Express: Destination Pyramids / PYRAMIDS.ISO / DEMO / EDMARKDB / SHARED.DXR / 01001_All Tempo Scripts.ls next >
Encoding:
Text File  |  1995-10-20  |  2.9 KB  |  144 lines

  1. on waitTime theTime
  2.   global tempTimer
  3.   if tempTimer > 0 then
  4.     if tempTimer < the ticks then
  5.       go(the frame + 1)
  6.       set tempTimer to 0
  7.     else
  8.       go(the frame)
  9.     end if
  10.   else
  11.     set tempTimer to the ticks + (theTime * 60)
  12.     go(the frame)
  13.   end if
  14. end
  15.  
  16. on waitSound theChannel
  17.   if soundBusy(theChannel) then
  18.     go(the frame)
  19.   end if
  20. end
  21.  
  22. on stopAndWait theChannel
  23.   set xx to 1
  24.   repeat while xx
  25.     if not soundBusy(theChannel) then
  26.       exit repeat
  27.     end if
  28.   end repeat
  29. end
  30.  
  31. on stopAndWaitTime theTime
  32.   set xx to the ticks + (theTime * 60)
  33.   repeat while the ticks < xx
  34.     nothing()
  35.   end repeat
  36. end
  37.  
  38. on waitForQT theChannel
  39.   set xx to the stopTime of sprite theChannel
  40.   if the movieTime of sprite theChannel < xx then
  41.     go(the frame)
  42.   end if
  43. end
  44.  
  45. on LoopOnSound theChannel, theMarker
  46.   set mm to theMarker
  47.   set cc to theChannel
  48.   if value(mm) = EMPTY then
  49.     if soundBusy(cc) then
  50.       go(mm)
  51.     end if
  52.   else
  53.     if soundBusy(cc) then
  54.       go(marker(mm))
  55.     end if
  56.   end if
  57. end
  58.  
  59. on LoopOnTime theSeconds, theMarker
  60.   global tempTimer
  61.   set mm to theMarker
  62.   set ss to theSeconds
  63.   if tempTimer > 0 then
  64.     if tempTimer < the ticks then
  65.       go(the frame + 1)
  66.       set tempTimer to 0
  67.     else
  68.       go(marker(mm))
  69.     end if
  70.   else
  71.     set tempTimer to the ticks + (theSeconds * 60)
  72.     go(marker(mm))
  73.   end if
  74. end
  75.  
  76. on LoopOnQT theChannel, theMarker
  77.   set mm to theMarker
  78.   set cc to theChannel
  79.   set xx to the stopTime of sprite cc
  80.   if value(mm) = EMPTY then
  81.     if the movieTime of sprite cc < xx then
  82.       go(mm)
  83.     end if
  84.   else
  85.     if the movieTime of sprite cc < xx then
  86.       go(marker(mm))
  87.     end if
  88.   end if
  89. end
  90.  
  91. on cursorClick theChannel, theTotal
  92.   global movieCastList
  93.   set tempCursor to the name of cast the castNum of sprite theChannel
  94.   puppetSprite(theChannel, 1)
  95.   if theTotal < 0 then
  96.     if movieCastList = EMPTY then
  97.       alert("gotta use loadCastList first")
  98.       exit
  99.     end if
  100.     repeat with xx = 1 to count(movieCastList)
  101.       set tempchecker to string(tempCursor & xx)
  102.       if doesCastExist(tempchecker) = 0 then
  103.         exit repeat
  104.       end if
  105.     end repeat
  106.     if xx < 1 then
  107.       exit
  108.     end if
  109.   else
  110.     set xx to theTotal
  111.   end if
  112.   repeat with nn = 1 to xx
  113.     set the castNum of sprite theChannel to the number of cast (tempCursor & nn)
  114.     updateStage()
  115.   end repeat
  116.   set the castNum of sprite theChannel to the number of cast tempCursor
  117.   puppetSprite(theChannel, 0)
  118.   updateStage()
  119. end
  120.  
  121. on loadCastList
  122.   global movieCastList
  123.   set movieCastList to []
  124.   repeat with xx = 1 to the number of castMembers
  125.     if the name of cast xx <> "0" then
  126.       append(movieCastList, the name of cast xx)
  127.     end if
  128.   end repeat
  129. end
  130.  
  131. on doesCastExist theName
  132.   global movieCastList
  133.   if movieCastList = EMPTY then
  134.     loadCastList()
  135.   end if
  136.   return getPos(movieCastList, theName)
  137. end
  138.  
  139. on clearPuppets theBeg, theEnd
  140.   repeat with nn = theBeg to theEnd
  141.     puppetSprite(nn, 0)
  142.   end repeat
  143. end
  144.